home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 March / Gamestar_71_2005-03_dvd.iso / Dema / willofsteel_demo.exe / {app} / Data / Shaders / Terrain00.fx < prev    next >
Text File  |  2004-10-23  |  4KB  |  145 lines

  1. float4x4 WorldViewProjection;
  2. float4x4 ShadowViewProjection;
  3. float4x4 TextureMatrix;
  4.  
  5. texture AlphaTexture;
  6. texture DiffuseTexture;
  7. texture ShadowTexture;
  8. texture CloudsTexture;
  9. texture FogOfWar;
  10.  
  11. float3 LightDirection = { 0.0f, 0.0f, 0.0f };
  12. float3 SunColor       = { 1., 0.86, .70 };//, 1.0 };
  13. float3 Ambient        = { 0.24, 0.12, 0.04 };//, 1.0 };
  14. float4 FogScale          = { 0.001953125, 0.001953125, 0.001953125, 0.001953125 };    
  15. float4 ZBias          = { 0.0, 0.0, 0.0, 0.003 };
  16. float4 ShadowOffset;
  17. float4 CloudUVShift    = { 0.0, 0.0, 0.0, 0.0 };
  18. float4 CloudScale      = { 0.01, 0.01, 0.01, 0.01 };
  19.  
  20. technique Technique0
  21. {
  22.     pass Pass0
  23.     {
  24.         Texture[0]               = (DiffuseTexture);
  25.  
  26.         ColorOp[0]                 = MODULATE;
  27.         ColorArg1[0]             = TEXTURE;
  28.         ColorArg2[0]             = DIFFUSE;
  29.  
  30.         ColorOp[1]                 = MODULATE;
  31.         ColorArg1[1]             = TEXTURE;
  32.         ColorArg2[1]             = CURRENT;
  33.  
  34.         AlphaOp[0]                 = DISABLE;
  35.         ColorOp[2]                 = DISABLE;
  36.  
  37.         Texture[1]               = (FogOfWar);
  38.  
  39.         VertexShaderConstant[0]   = <WorldViewProjection>;
  40.         VertexShaderConstant[27]  = <FogScale>;
  41.         VertexShaderConstant[28]  = <Ambient>;
  42.         VertexShaderConstant[30]  = <LightDirection>;
  43.         VertexShaderConstant[31]  = <ZBias>;
  44.         VertexShaderConstant[32]  = <SunColor>;
  45.  
  46.         VertexShader =
  47.         decl
  48.         {
  49.             stream 0;
  50.             float v0[3];    
  51.             float v3[3];    
  52.             float v6[2];    
  53.         }
  54.         asm
  55.         {
  56.             vs_1_1
  57.  
  58.             dcl_position v0
  59.             dcl_normal v3
  60.             dcl_texcoord0  v6
  61.  
  62.             m4x4  oPos, v0, c0        
  63.             mul   r0, v0, c27
  64.             mov   oT1.x, r0.x       
  65.             mov   oT1.y, r0.z       
  66.  
  67.             m4x4  r0, v0, c12        
  68.             mov   oT0, v6           
  69.             dp3   r0, v3, c30   
  70.             mov   r1, c32     
  71.             mad   oD0, r0, r1, c28
  72.        };
  73.        PixelShader = NULL;
  74.     }
  75. }
  76.  
  77. technique Technique1
  78. {
  79.     pass Pass0
  80.     {
  81.         Texture[0]               = (AlphaTexture);
  82.  
  83.         ColorOp[0]                 = SELECTARG1;
  84.         ColorArg1[0]             = DIFFUSE;
  85.  
  86.         AlphaOp[0]                 = SELECTARG1;
  87.         AlphaArg1[0]             = TEXTURE;
  88.  
  89.         Texture[1]               = (FogOfWar);
  90.  
  91.         ColorOp[1]                 = MODULATE;
  92.         ColorArg1[1]             = TEXTURE;
  93.         ColorArg2[1]             = CURRENT;
  94.  
  95.         AlphaOp[1]                 = DISABLE;
  96.         
  97.         Texture[2]               = (DiffuseTexture);
  98.         
  99.         ColorOp[2]                 = MODULATE;
  100.         ColorArg1[2]             = CURRENT;
  101.         ColorArg2[2]             = TEXTURE;
  102.         
  103.         ColorOp[3]                 = DISABLE;
  104.         
  105.  
  106.         VertexShaderConstant[0]   = <WorldViewProjection>;
  107.         VertexShaderConstant[27]  = <FogScale>;
  108.         VertexShaderConstant[30]  = <LightDirection>;
  109.         VertexShaderConstant[31]  = <ZBias>;
  110.         VertexShaderConstant[32]  = <SunColor>;
  111.         VertexShaderConstant[28]  = <Ambient>;
  112.  
  113.         VertexShader =
  114.         decl
  115.         {
  116.             stream 0;
  117.             float v0[3];       
  118.             float v3[3];       
  119.             float v6[2];       
  120.             float v8[2];       
  121.         }
  122.         asm
  123.         {
  124.             vs_1_1
  125.  
  126.             dcl_position v0
  127.             dcl_normal v3
  128.             dcl_texcoord0  v6
  129.             dcl_texcoord1  v8
  130.             m4x4  oPos, v0, c0    
  131.             mul   r0, v0, c27
  132.             mov   oT1.x, r0.x      
  133.             mov   oT1.y, r0.z      
  134.             m4x4  r0, v0, c12    
  135.             mov   oT2, v6          
  136.             mov   oT0, v8
  137.             dp3   r0, v3, c30 
  138.             mov   r1, c32     
  139.             mad   oD0, r0, r1, c28
  140.         };
  141.  
  142.         PixelShader = NULL;
  143.     }
  144. }
  145.